package com.bjmashibing.system.OSFileIO.io_demo.handlerStream;

import java.io.*;

public class InputputStreamReaderDemo {
    public static void main(String[] args) throws IOException {
        demo1();
    }

    private static void demo1() throws IOException {
        File file = new File("src/Java_IO/io_demo/Resources/abc.txt");
        FileInputStream inputStream = new FileInputStream(file);
        InputStreamReader inputStreamReader = new InputStreamReader(inputStream,"utf-8");
        char[] chars=new char[1024];
        int length = inputStreamReader.read(chars);
        System.out.println(new String(chars,0,length));
        inputStreamReader.close();
        inputStream.close();
    }
}
